<?php

namespace App;

use Illuminate\Database\Eloquent\Builder;
use Spatie\SchemalessAttributes\SchemalessAttributes;
use Illuminate\Database\Eloquent\Model;

trait HasSchemalessAttributes
{
	public function getExtraAttributesAttribute() : SchemalessAttributes
	{
		return SchemalessAttributes::createForModel($this, 'extra_attributes');
	}

	public function scopeWithExtraAttributes() : Builder
	{
		return SchemalessAttributes::scopeWithSchemalessAttributes('extra_attributes');
	}

}
